using System;
using System.Collections.Generic;
using System.Text;

namespace TextSupport
{
	/// <summary>
	/// This class represents the surface within an outline node that
	/// the user can type text into.  It mostly just passes stuff up to the
	/// surface the outline lives in
	/// </summary>
	internal class OutlineNodeTextSurface : IEditSurface
	{
		private IEditSurface _parentSurface;
		public IEditSurface ParentSurface
		{
			get { return _parentSurface; }
			set { _parentSurface = value; }
		}

		private OutlineNode _parentNode;
		public OutlineNode ParentNode
		{
			get { return _parentNode; }
			set { _parentNode = value; }
		}
	
		internal OutlineNodeTextSurface(IEditSurface parentSurface, OutlineNode parentNode)
		{
			_parentNode = parentNode;
			_parentSurface = parentSurface;
		}

		#region IEditSurface Members

		public System.Drawing.RectangleF GetExtent()
		{
			return _parentSurface.GetExtent();
		}

		public System.Drawing.Graphics GetGraphics()
		{
			return _parentSurface.GetGraphics();
		}

		public System.Drawing.Font GetDefaultFont()
		{
			return _parentSurface.GetDefaultFont();
		}

		public void Invalidate()
		{
			_parentSurface.Invalidate();
		}

		public void Invalidate(System.Drawing.RectangleF rect)
		{
			_parentSurface.Invalidate(rect);
		}

		public void RestartCaretTimer()
		{
			// TODO: Caret timer cascade
		}
		#endregion
	}
}
